package com.healthy.service;

import com.healthy.entity.Customerprofile;
import com.healthy.mapper.CustomerprofileMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class CustomerprofileService {

    @Autowired
    CustomerprofileMapper customerprofileMapper;

    //    查询全部
    public List<Customerprofile> cuList() {
        return customerprofileMapper.culist();
    }

    //    添加
    public Customerprofile cuInsert(Customerprofile customerprofile) {

        customerprofileMapper.cuInsert(customerprofile);
        return customerprofile;
    }

    //    删除
    public int cuDeleteByid(int id) throws Exception {
        int res = customerprofileMapper.cuDeleteByid(id);
        if (res > 0) {
            return 1;
        } else {
            return 0;
        }
    }
//    修改
    public int cuUpdateByid(int id,String name,String sex,String phone,String doctor) throws Exception {
        int res = customerprofileMapper.cuUpdateByid(id,name,sex,phone,doctor);
        if (res > 0) {
            return 1;
        } else {
            return 0;
        }
    }
}
